import Request from '../utils/request'
import { Count, Trendency, Quote, BannedCount, DepartmentPublish, TrendencyQuery,LawTrendency } from './types/basiscensus'
import { Wrapper } from './types/result'
/**
 * 依据统计 star
 */
// 政策数量
export function getPolicyCount() {
  return Request<Wrapper<Count>>({
    url: '/api/app/policyinfo/getCount',
    method: 'GET'
  })
}

// 政策发布趋势
export function getPolicyTendency(query:TrendencyQuery) {
  return Request<Wrapper<Array<Trendency>>>({
    url: '/api/app/policyinfo/getTendency',
    method: 'GET',
    params: query
  })
}

// 政策引用次数
export function getPolicyQuote() {
  return Request<Wrapper<Array<Quote>>>({
    url: '/api/app/policyinfo/getQuote',
    method: 'GET'
  })
}

// 法律法规数量
export function getLawCount() {
  return Request<Wrapper<Count>>({
    url: '/api/app/policyinfo/getCount',
    method: 'GET',
  })
}

// 法律法规发布趋势
export function getLawTendency(query:TrendencyQuery) {
  return Request<Wrapper<Array<LawTrendency>>>({
    url: '/api/app/regulationinfo/getTendency',
    method: 'GET',
    params:query
  })
}

// 法律法规引用次数
export function getLawQuote(params: any) {
  return Request<Wrapper<Array<Quote>>>({
    url: '/app/regulationinfo/getQuote',
    method: 'GET',
    params
  })
}

// 禁售词库上报数量
export function getBannedCount() {
  return Request<Wrapper<BannedCount>>({
    url: '/api/app/dictinfo/getCount',
    method: 'GET'
  })
}

// 各部门发布词库数量
export function getDeparmentPublish() {
  return Request<Wrapper<DepartmentPublish>>({
    url: '/api/app/dictinfo/getcountByOrg',
    method: 'GET'
  })
}

// 词库引用前十
export function getBannedQuote() {
  return Request<Wrapper<Array<Quote>>>({
    url: '/app/dictinfo/getTen',
    method: 'GET'
  })
}